/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.supplier.store;

import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.Q350;
import queenb.net.entitybean.V350;
import queenb.web.permission.store.Q350Store;
import queenb.web.supplier.interfaca.V350Inf;
import queenb.web.util.PackageContants;

/**
 *
 * @author VANANH
 */
public class V350Store extends V350 implements V350Inf {

    @Override
    public List<V350> getListV350All(int pnFH000, int pnFH200, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_V350, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.CHAR, pvLOGIN),});
        try {
            return super.find(dataStatement, V350.class);
        } catch (SQLException ex) {
            Logger.getLogger(V350Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(V350Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(V350Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public int updateV350(int pnPV350, int pnFH000, int pnFH200, int pnFH250, String pvVV351, String pvVV352, String pvVV353, String pvVV354, String pvVV355, String pvLOGIN) {
        try {
            DataStatement dateStatement = new DataStatement(PackageContants.UPDATE_V350, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPV350),
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFH250),
                        new Param(OracleTypes.CHAR, pvVV351),
                        new Param(OracleTypes.CHAR, pvVV352),
                        new Param(OracleTypes.CHAR, pvVV353),
                        new Param(OracleTypes.CHAR, pvVV354),
                        new Param(OracleTypes.CHAR, pvVV355),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(dateStatement, V350.class);
        } catch (SQLException ex) {
            Logger.getLogger(V350Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    @Override
    public int deleteV350(int pnPV350, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.DELETE_V350, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPV350),
                    new Param(OracleTypes.CHAR, pvLOGIN)});
        try {
            return super.update(dataStatement, V350.class);
        } catch (SQLException ex) {
            Logger.getLogger(V350Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }
}
